//
//  NSString+file.m
//  weibo
//
//  Created by apple on 13-8-28.
//  Copyright (c) 2013年 itcast. All rights reserved.
//


#import "NSString+File.h"

@implementation NSString (File)
- (NSString *)filenameAppend:(NSString *)append
{
    NSString *filename = [self stringByDeletingPathExtension];
    filename = [filename stringByAppendingString:append];
    NSString *extension = [self pathExtension];
    extension =[extension isEqualToString:@""]? @"png":extension;
    return [filename stringByAppendingPathExtension:extension];
}

+ (NSString *)fullscreenImageNameWithName:(NSString *)name
{
    if (iPhone4) {
        name =[name filenameAppend:@"@2x"];;
    }
    if (iPhone5) {
        name = [name filenameAppend:@"-568h@2x"];
    }
    if (iPhone6) {
        name =[name filenameAppend:@"-667h@2x"];
    }
    if (iPhone6p) {
        name =[name filenameAppend:@"-736h@3x"];
    }
    return name;
}
@end
